package com.lagou.concurrent.demo;

public class UserThread extends Thread{
    private NumberResource resource;

    public UserThread(NumberResource resource) {
        this.resource = resource;
    }

    @Override
    public void run() {
        while (true) {
            try {
                resource.showNumber();
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
    }
}
